\documentclass[a4paper,twoside,11pt]{report}
%\documentclass[a4paper,singleside,11pt]{report}
\usepackage{ia_urb_thesis}
\usepackage[italian]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{mathpartir}
\usepackage{stmaryrd}  
\usepackage{amsmath}
\usepackage{epsfig}
\usepackage{calrsfs}

\newcommand{\NT}[1]{\langle\mathit{#1}\rangle}
\newcommand{\T}[1]{\mathit{#1}}

\newcommand{\flang}{$\mathcal{F}$}
\newcommand{\olang}{$\mathcal{O}$}
\newcommand{\cflang}{$\mathcal{F}^{+}$}
\newcommand{\colang}{$\mathcal{O}^{+}$}

\newcommand{\INT}{\T{int}}
\newcommand{\BOOL}{\T{bool}}
\newcommand{\FLOAT}{\T{float}}
\newcommand{\STRING}{\T{string}}
\newcommand{\SYMBOL}{\T{symbol}}

\newcommand{\EXPR}{E}
\newcommand{\VAL}{v}
\newcommand{\VARVAL}{w}
\newcommand{\VAR}{x}
\newcommand{\REF}{r}
\newcommand{\RULE}{\NT{rule}}
\newcommand{\CONST}{k}
\newcommand{\PATTERN}{\NT{pattern}}
\newcommand{\BIND}{\NT{bind}}
\newcommand{\GLOBAL}{\NT{global}}
\newcommand{\PRIM}[1]{\mathit{op}^{(#1)}}

\newcommand{\CLASS}{\mathit{CL}}
\newcommand{\CLASSID}{\mathsf{C}}
\newcommand{\VARCLASSID}{\mathsf{D}}
\newcommand{\FIELDID}{\mathsf{f}}
\newcommand{\VARFIELDID}{\mathsf{g}}
\newcommand{\METHODID}{\mathsf{m}}
\newcommand{\OBJECTID}{\mathsf{o}}
\newcommand{\VAROBJECTID}{\mathsf{p}}
\newcommand{\FIELD}{\NT{field}}
\newcommand{\HEAP}{h}
\newcommand{\CTOR}{K}
\newcommand{\METHOD}{M}
\newcommand{\nil}{\mathtt{nil}}
\newcommand{\CLOSUREID}[1]{\mathtt{Closure}\langle#1\rangle}
\newcommand{\PAPID}[2]{\mathtt{PAP}\langle#1,#2\rangle}
\newcommand{\APPLY}[1]{\mathtt{apply}\langle#1\rangle}
\newcommand{\VALUE}{\mathtt{Value}}
\newcommand{\MAXARGS}{M}

\newcommand{\INSTR}[1]{\mathsf{#1}}
\newcommand{\TRUE}{\mathsf{true}}
\newcommand{\FALSE}{\mathsf{false}}
\newcommand{\THIS}{\mathtt{this}}

\newcommand{\BOXN}[1]{[]_{#1}}
\newcommand{\BOX}[1]{[#1]}
\newcommand{\ENV}{\mathcal{E}}
\newcommand{\LOC}{\mathcal{L}}
\newcommand{\ARGS}{\mathcal{A}}

\newcommand{\TRANS}{\Rightarrow}
\newcommand{\AFTER}{\vdash}

\newcommand{\knew}[1]{\mathtt{new}_{#1}~\REF_1=\CLASSID_1(\EXPR_1\cdots\EXPR_m)\cdots\REF_n=\CLASSID_n(\EXPR_1\cdots\EXPR_l)}
\newcommand{\kfix}[1]{\mathtt{fix}_{#1}~\VAR_1=\VAL_1\cdots\VAR_n=\VAL_n}
\newcommand{\varkfix}[1]{\mathtt{fix}_{#1}~\sequence{\VAR}=\sequence{\VAL}}

\newcommand{\sequence}[1]{\overline{#1}}
\newcommand{\seqlen}[1]{\#(#1)}

\newcommand{\EVAL}[1]{\mathcal{E}[#1]}
\newcommand{\COMPILE}[3]{\llbracket\,#1\,\rrbracket^{#2}_{#3}}

\newcommand{\rtsyntax}[1]{\colorbox{lightgray}{\ensuremath{#1}}}
\newcommand{\subst}[2]{
	\{ 	\raisebox{.5ex}{$#1$}  /  
			\raisebox{-.5ex}{$#2$} \} 
	} % substitution
\newcommand{\subt}{\mathrel{<:}}
\newcommand{\fields}{\mathit{fields}}
\newcommand{\CT}{\mathit{CT}}
\newcommand{\body}{\mathit{body}}
\newcommand{\dom}{\mathrm{dom}}
\newcommand{\rulename}[1]{\textsc{(#1)}}
\newcommand{\fv}{\mathit{fv}}

\newcommand{\type}[1]{\mathtt{\langle type_{#1} \rangle}}
\newcommand{\typep}{\mathtt{\langle primitive~type\rangle}}

\usepackage{listings}
\lstloadlanguages{[Objective]Caml} 


\lstdefinestyle{OCAML}
  {language=[Objective]Caml,
   print=true,
   basicstyle =\small,
   stringstyle=\ttfamily,
  }


\lstnewenvironment{ScriptMath}
  {\lstset{language=[Objective]Caml,
      print=true,
      basicstyle=\small\ttfamily,
      mathescape=true}
   %\lstset{mathescape=true}
  }
  {}

%%%%%%%%%%%%%%%%%%%%

\begin{document}

\titolo{Implementazione di un linguaggio\\[5mm] funzionale in un 
linguaggio\\[5mm] a oggetti puro}

\candidato{Iacopo Pazzaglia}
\relatore{Chiar.mo Dott.~Luca Padovani}
\annoaccademico{2008-2009}

\copertinatesi 
%\dedica{Ai miei genitori}
\indice
%\indicefigure
%\indicetabelle
\iniziatesto

\cleardoublepage
\include{cap1}
\cleardoublepage
\include{cap2}
\cleardoublepage
\include{cap3}
\cleardoublepage
\include{cap4}

%\appendix
%\include{app_a}
\include{biblio}

%\ringraziamenti
%Vorrei ringraziare ...

%\nocite{*}
%\bibliographystyle{plain}
%\bibliography{biblio}
\end{document}
